*********************************************************************************
/*   Single-diff event study, by 2-3 year groups	*/
*********************************************************************************

* File paths
local datapath "${mvpf_audits}/data/cleaned" 
local datafolder "${mvpf_audits}/data/outside" 
local graphpath "${graphpath}" 

* Version of fig to produce 
global version  ${version} // paper or slides

* Other formatting
if "${version}" == "slides" {
	global title "title(" ", size(vhuge))"
	global img wmf
	graph set window fontface "Arial"
	global title "title(" ", size(vhuge))"
	global axis_size "" //xsize(6.5) ysize(4)" // makes figure wider
}

else if "${version}" == "paper" {
	global title "title("")"
	global img pdf
	graph set window fontface "LMRoman10-Regular"
	global title " "
	global axis_size " " // makes figure wider
}

/*------------------------------------------------------------------------------
Plot event studies by year
------------------------------------------------------------------------------*/

use "${mvpf_audits}/data/figures_rep/ap13_b.dta", clear

	* plot event study
	twoway  (rspike coeff67_h coeff67_l event67, lc(gs4) lw(thin)) ///
			(rspike coeff89_h coeff89_l event89, lc(gs11) lw(thin)) ///
			(rspike coeff1011_h coeff1011_l event1011, lc(sky) lw(thin)) ///
			(rspike coeff1214_h coeff1214_l event1214, lc(sea) lw(thin)) ///
			(scatter coeff67 event67, mc(gs4) msize(small) ms(O)) ///
			(line coeff67 event67, lc(gs4)) ///
			(scatter coeff89 event89, mc(gs9) msize(small) ms(T) msize(vsmall)) ///
			(line coeff89 event89, lc(gs9)) ///
			(scatter coeff1011 event1011, mc(sky) msize(small) ms(S)) ///
			(line coeff1011 event1011, lc(sky)) ///
			(scatter coeff1214 event1214, mc(sea) msize(small) ms(D) msize(vsmall)) ///
			(line coeff1214 event1214, lc(sea)) ///
			, ///
			xline(0.5, lw(vthin) lc(gs11)) ///
			yline(0, lw(vthin) lc(gs11)) ///
			xtitle("Year relative to tax year of audited return") ///
			ytitle("Taxes Paid") ///
			xlabel(-14(2)14 , nogrid) ///
			ylab(-500(500)1500, nogrid format(%5.0fc)) yscale(r(-400 1500))  ///
			legend(ring(0) pos(11) row(2) symxsize(*0.3) order(5 7 9 11) ///
			lab(5 "2006-2007") lab(7 "2008-2009")  ///
			lab(9 "2010-2011") lab(11 "2012-2014") ) ///
			${title} ${axis_size}	
	graph export "`graphpath'/event_study_taxes_paid_alt_years_v2.wmf", as(wmf) replace